<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<body>
    <nav th:fragment="menu(n)" class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="#">新闻管理系统</a>
            </div>

            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <li th:classappend="${n==1}?'active'"><a href="index.html" th:href="@{/index}"  >主页<span class="sr-only">(current)</span></a></li>
                    <li th:classappend="${n==2}?'active'"><a href="backstage.html"  th:href="@{/backstage/{userId}/{pagesNum}(userId=${session.user!=null}?${session.user.id}:'',pagesNum=1)}">新闻管理</a></li>
                    <li th:classappend="${n==3}?'active'" ><a href="backstage.html" th:href="@{/admin/-1}">后台管理</a></li>
                    <li class="dropdown" th:classappend="${n==4}?'active'">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">更多<span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li th:each="type : ${session.types}"><a href="#" th:text="${type.name}" th:href="@{/newstype/{typeId}/{pageNum}(typeId=${type.id},pageNum=1)}">娱乐</a></li>

                        </ul>
                    </li>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    <li><a href="register.html" th:href="@{/registers}" th:if="${session.user==null}">注册</a></li>
                    <li><a href="login.html" th:href="@{/logins}" th:if="${session.user==null}">登陆</a></li>
                    <li class="dropdown">

                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="glyphicon glyphicon-user" aria-hidden="true"></span>[[${session.user!=null}?${session.user.nickname}:'游客状态']]<span class="caret" th:if="${session.user!=null}"></span></a>
                        <ul class="dropdown-menu dropdown-menu-left" th:if="${session.user!=null}">
                            <li><a href="publish.html" th:href="@{/publishs}">发布新闻</a></li>
                            <li><a href="backstage.html" th:href="@{/backstage/{userId}/{pageNum}(userId=${session.user!=null}?${session.user.id}:'',pageNum=1)}">新闻管理</a></li>
                            <li role="separator" class="divider"></li>
                            <li><a href="#" th:href="@{/logout}">退出登陆</a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </nav>

    <!-- 底部-->
    <footer th:fragment="footer" >
    <div class="container L_bg2 bgblack3">
        <div class="L_footerbox1 col-md-3 text-center"><img class="L_footerimg" src="../static/images/4.png" th:src="@{/images/4.png}"></div>
        <div class="L_footerbox2 col-md-3 text-center">
            <h4>联系我们</h4>
            <span>Email:957963843@qq.com</span>
            <br />
            <span>QQ:957963843</span>
        </div>
        <div class="L_footerbox3 col-md-6 text-center"><h2>版权为1703班软件工程第8组所有</h2></div>
    </div>
</footer>


    <!-- script -->
    <th:block th:fragment="script">

    </th:block>


</body>
</html>